package com.jrx.anytxn.reporting.job.xib.step;

import com.jrx.anytxn.reporting.entity.AmlIATrading;
import com.jrx.anytxn.reporting.service.IXibService;
import com.jrx.anytxn.transaction.entity.AmLoanMainInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.batch.item.ItemProcessor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class TradingProcessor implements ItemProcessor<AmLoanMainInfo, AmlIATrading> {

    @Autowired
    private IXibService xibService;

    private static final Logger logger = LoggerFactory.getLogger(TradingProcessor.class);


    @Override
    public AmlIATrading process(AmLoanMainInfo item) throws Exception {
        try {
            return xibService.assemTrading(item);
        } catch (Exception e) {
            e.printStackTrace();
            logger.error("generateTradingJob 出错了：{}", e.getMessage());
        }
        return null;
    }
}
